package controller.admin.order;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import service.Impl.OrderServiceImpl;
import util.ResultUtil;

import java.io.IOException;

@WebServlet("/admin/order/complete")
public class OrderCompleteController extends HttpServlet {
    //完成订单
    @Override
    protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id= Integer.parseInt(req.getParameter("id"));
        OrderServiceImpl os=new OrderServiceImpl();
        os.complete(id);
        String json= ResultUtil.getJSON(null);
        resp.getWriter().println(json);
    }
}
